package com.cn.pack.controller;

import com.cn.pack.Student;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(path = "/hello")
public class HelloController {

    //@RequestMapping(path = "/query", method = RequestMethod.POST)
    @RequestMapping(path = "/query", method = RequestMethod.GET)
    public Student query(/*@RequestBody*/ Student student) {
        System.out.println("student = " + student.toString());
        Map<String, Object> map = new HashMap<>();
        map.put("学校", "清华");
        map.put("收入", 20000.00);
        student.setMap(map);
        return student;
    }
}
